home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / C++ / Frameworks / GameShell / Sourcery / GameShell.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-12-03  |  1.3 KB  |  61 lines  |  [TEXT/CWIE]

  1. #ifndef GAMESHELL_H_
  2. #define GAMESHELL_H_
  3.  
  4. /*
  5.     GameShell.h
  6.     Written by Hiep Dam
  7.     From The Witches' Brew
  8.     Version 1.0
  9.     Dec 2 95
  10.  
  11.     A simplified gameshell for Mac game programmers. Deals with most
  12.     of the MacOS so you don't have to!
  13.     
  14.     Handles:
  15.         - hiding/showing menubar
  16.         - backdrop windows for current and all monitors
  17.         - appropriate behavior when switching in/out of GameShell
  18. */
  19.  
  20. #ifndef CP_DATA_H_
  21.     #include "CP_Data.h"
  22. #endif
  23.  
  24.  
  25. typedef struct {
  26.     short windowWidth;
  27.     short windowHeight;
  28.     
  29.     short preferredDepth;
  30.     short minimumDepth;
  31.     
  32.     short useBackdrop;
  33.     short useBlackout;
  34.     short useMenuBar;
  35.     short padding;
  36.  
  37.     void (*menuInitFunction)();                    // Optional
  38.     void (*menuHandlerFunction)(long);            // Optional
  39.  
  40.     void (*keyHandlerFunction)(long);            // Optional
  41.     
  42.     void (*idleHandlerFunction)();                // Optional
  43.  
  44.     void (*mainWindowUpdateFunction)();            // Mandatory
  45.     void (*mouseHandlerFunction)(CP_Point*);    // Mandatory
  46. } UserParameters;
  47.  
  48.  
  49. OSErr GameShellInitialize(UserParameters *userInfo);
  50. void GameShellCleanup();
  51. void GameShellLoop();
  52.  
  53. CP_Window_Ref GameShellGetMainWindow();
  54. CP_OutputDevice_Ref GameShellGetOutputDevice();
  55. void GameShellGetWindowCoords(CP_Rect *globCoords);
  56.  
  57. // Pass true or false; usually you'll just pass
  58. // true to quit the shell
  59. void GameShellSetQuitFlag(long quitFlag);
  60.  
  61. #endif // GAMESHELL_H_